package com.jinxin.phonecloudmusic.myapplication.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.jinxin.phonecloudmusic.myapplication.R;
import com.jinxin.phonecloudmusic.myapplication.entity.MusicBean.SongList;
import com.jinxin.phonecloudmusic.myapplication.entity.MusicDown;

import java.util.List;

/**
 * Created by ZJ on 2017/11/29 0029.
 * 下载
 */

public class MusicDownListAdapter extends QuickAdapter<MusicDown>{
    public MusicDownListAdapter(Context context, int res, List<MusicDown> data) {
        super(context, res, data);
    }

    @Override
    public View getItemView(int position, View convertView, ViewHolder holder) {
        String MusicName=data.get(position).getMusicName();
        String songerName=data.get(position).getSongName();
        TextView tvListNum=holder.getView(R.id.tv_home_page_list_num);
        TextView tvListName=holder.getView(R.id.tv_home_page_list_name);
        TextView tvSongerName=holder.getView(R.id.tv_home_page_songer_name);
        ImageView ivMusicDownLoad=holder.getView(R.id.iv_music_download);
            if (position<9){
                tvListNum.setText("0"+(position+1));
            }else {
                tvListNum.setText(position+1);
            }
        tvListName.setText(MusicName);
        tvSongerName.setText(songerName);
        return convertView;
    }
}
